//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

namespace Engine
{
namespace Utils
{
	
	struct EPixelFormat
	{
		enum type
		{
			_UNKNOWN		= 0,

			// flags
			_UNSIGNED		= 0x010000,
			_SIGNED			= 0x020000,
			_NORMALIZED		= 0x040000,		// bits
			_FLOAT			= 0x080000,		// bytes
			_COMPRESSED		= 0x800000,		// index
			_COLOR			= 0x100000,
			_DEPTH			= 0x200000,		// bytes
			_STENCIL		= 0x400000,		// bits

			// unsigned normalized
			ALPHA8			= _UNSIGNED | _NORMALIZED | _COLOR | 0x0008,	//  8 bit
			R5_G6_B5		= _UNSIGNED | _NORMALIZED | _COLOR | 0x5650,	// 16 bit
			RGB8			= _UNSIGNED | _NORMALIZED | _COLOR | 0x8880,	// 24 bit
			RGB5_A1			= _UNSIGNED | _NORMALIZED | _COLOR | 0x5551,	// 16 bit
			RGBA4			= _UNSIGNED | _NORMALIZED | _COLOR | 0x4444,	// 16 bit
			RGBA8			= _UNSIGNED | _NORMALIZED | _COLOR | 0x8888,	// 32 bit
			// (EXT_texture_rg)
			R8				= _UNSIGNED | _NORMALIZED | _COLOR | 0x8000,	//  8 bit
			RG8				= _UNSIGNED | _NORMALIZED | _COLOR | 0x8800,	// 16 bit

			// float (EXT_texture_storage)
			RGBA32F			= _FLOAT | _COLOR | 0x4444,		// 128 bit
			RGBA16F			= _FLOAT | _COLOR | 0x2222,		// 64 bit
			RGB32F			= _FLOAT | _COLOR | 0x4440,		// 96 bit
			RGB16F			= _FLOAT | _COLOR | 0x2220,		// 48 bit
			RG32F			= _FLOAT | _COLOR | 0x4400,		// 64 bit
			RG16F			= _FLOAT | _COLOR | 0x2200,		// 32 bit
			R32F			= _FLOAT | _COLOR | 0x4000,		// 32 bit
			R16F			= _FLOAT | _COLOR | 0x2000,		// 16 bit
			ALPHA32F		= _FLOAT | _COLOR | 0x0004,		// 32 bit
			ALPHA16F		= _FLOAT | _COLOR | 0x0002,		// 16 bit
			
			// float (EXT_texture_storage) normalized
			RGBA32F_NORM	= _FLOAT | _COLOR | 0x4444 | _NORMALIZED,	// 128 bit
			RGBA16F_NORM	= _FLOAT | _COLOR | 0x2222 | _NORMALIZED,	// 64 bit
			RGB32F_NORM		= _FLOAT | _COLOR | 0x4440 | _NORMALIZED,	// 96 bit
			RGB16F_NORM		= _FLOAT | _COLOR | 0x2220 | _NORMALIZED,	// 48 bit
			RG32F_NORM		= _FLOAT | _COLOR | 0x4400 | _NORMALIZED,	// 64 bit
			RG16F_NORM		= _FLOAT | _COLOR | 0x2200 | _NORMALIZED,	// 32 bit
			R32F_NORM		= _FLOAT | _COLOR | 0x4000 | _NORMALIZED,	// 32 bit
			R16F_NORM		= _FLOAT | _COLOR | 0x2000 | _NORMALIZED,	// 16 bit
			ALPHA32F_NORM	= _FLOAT | _COLOR | 0x0004 | _NORMALIZED,	// 32 bit
			ALPHA16F_NORM	= _FLOAT | _COLOR | 0x0002 | _NORMALIZED,	// 16 bit

			// depth
			D16				= _DEPTH | 0x200,				// 16 bit
			D24				= _DEPTH | 0x300,				// 24 bit
			D32				= _DEPTH | 0x400,				// 32 bit

			// stencil
			S1				= _STENCIL | 0x1,				// 1 bit (OES_stencil1)
			S4				= _STENCIL | 0x4,				// 4 bit (OES_stencil4)
			S8				= _STENCIL | 0x8,				// 8 bit

			// depth stencil
			D24_S8			= _DEPTH | _STENCIL | 0x308,	// 32 bit (OES_packed_depth_stencil)


			// compressed
			RGB_ETC1		= _COMPRESSED | _COLOR | 0x1,	// 4 bit
		};
	};

}	// Utils
}	// Engine